<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<h3><fmt:message key="event.edit.heading" /></h3>
<form:form method="post" commandName="eventEdit">
	<table class="borderdlist">
		<tr>
			<td align="right" width="20%"><fmt:message key="event.name" /></td>
			<td width="20%"><form:input path="name" /></td>
			<td width="60%"><form:errors path="name" cssClass="error" /></td>
		</tr>
		<tr>
			<td align="right" width="20%"><fmt:message
				key="event.description" /></td>
			<td width="20%"><form:textarea cols="20" rows="3"
				path="description" /></td>
			<td width="60%"><form:errors path="description" cssClass="error" />
			</td>
		</tr>
		<tr>
			<td align="right" width="20%"><fmt:message key="event.owner" /></td>
			<td width="20%"><form:select path="owner">
				<c:forEach var="administrator" items="${eventEdit.administrators}">				
					<form:option value="${administrator.id}">${administrator.name}</form:option>
				</c:forEach>
			</form:select></td>
			<td width="60%"><form:errors path="owner" cssClass="error" /></td>
		</tr>
		<tr>
			<td align="right" width="20%"><fmt:message key="event.server" /></td>
			<td width="20%">
			     <form:select path="server">
				<c:forEach var="server" items="${eventEdit.servers}">
					<form:option value="${server.id}">${server.name}</form:option>
				</c:forEach>
			</form:select></td>
			<td width="60%"><form:errors path="server" cssClass="error" /></td>
		</tr>
		<tr>
			<td align="right" width="20%"><fmt:message key="event.hour" />:<fmt:message key="event.minute" /></td>
			<td width="20%"><form:select path="hour">
                <form:options items="${eventEdit.hours}" />
            </form:select>&nbsp;:&nbsp;<form:select path="minute">
				<form:options items="${eventEdit.minutes}" />
			</form:select></td>
			<td width="60%"><form:errors path="hour" cssClass="error" /><form:errors path="minute" cssClass="error" /></td>
		</tr>
		<tr>
			<td align="right" width="20%"><fmt:message key="event.day" /></td>
			<td width="20%"><form:input path="day" /></td>
			<td width="60%"><form:errors path="day" cssClass="error" /></td>
		</tr>
		<tr>
			<td align="right" width="20%"><fmt:message key="event.month" /></td>
			<td width="20%"><form:select path="month">
				<form:options items="${eventEdit.months}" />
			</form:select></td>
			<td width="60%"><form:errors path="month" cssClass="error" /></td>
		</tr>
	</table>
	<br />
	<input type="submit" align="center" class="btn"
		onmouseover="this.className='btn btnhov'"
		onmouseout="this.className='btn'"
		value="<fmt:message key="application.save"/>" />
	<input type="reset" align="center" class="btn"
		onmouseover="this.className='btn btnhov'"
		onmouseout="this.className='btn'"
		value="<fmt:message key="application.reset"/>" />
	<input type="button" align="center" class="btn"
		onmouseover="this.className='btn btnhov'"
		onmouseout="this.className='btn'"
		onclick="document.location='<c:url value="events.htm"/>'"
		value="<fmt:message key="event.all.heading"/>" />
</form:form>
